package com.fuyao.cloud.daemon.quartz.util;

import com.fuyao.cloud.common.core.constant.SecurityConstants;
import com.fuyao.cloud.message.vo.MesRuleFormVO;
import com.fuyao.cloud.message.vo.MessageRuleVO;
import com.fuyao.cloud.personnel.api.feign.RemoteContractInfoService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * 规则处理类
 */
@Component
@AllArgsConstructor
public class MsgRuleDispose {

    private final RemoteContractInfoService contractInfoService;

    public List<MesRuleFormVO> disposeRules(List<MessageRuleVO> ruleVOS) {
        if (ruleVOS.get(0).getDocType().equals("ContractInfo")) {
            return this.contractInfoService.findAllUserId(ruleVOS, SecurityConstants.FROM_IN).getData();
        }
        return new ArrayList<>();
    }
}
